<style>
    .description { color: #008678; text-decoration: underline; font-size: 13px; }
</style>

<form method="post" action="/oss/?r=operation/doClear">
    <{include file='../common_params.tpl'}>
    <div class="box box-black">

        <div class="box-body">
            <table class="table table-bordered">
                <colgroup>
                    <col style="width: 20%;"></col>
                    <col style="width: 80%;"></col>
                </colgroup>

                <tr>
                    <th class="th-label">服务器</th>
                    <td>
                        <select class="form-control" name="server">
                            <{html_options options=$serverList selected=$server}>
                        </select>
                    </td>
                </tr>

                <tr class="tr-condition">
                    <th class="th-label">清理方式</th>
                    <td>
                        <select name="clear_by" id="sel-kick-type" class="form-control inline" style="width: 200px;">
                            <option value="1">按角色ID</option>
                            <option value="2">按角色名</option>
                            <option value="3">按玩家账号</option>
                        </select>
                    </td>
                </tr>

                <tr class="tr-condition">
                    <th class="th-label">清理类型</th>
                    <td>
                        <select name="clear_type" class="form-control inline" style="width: 200px;">
                            <option value="1">出生点</option>
                        </select>
                    </td>
                </tr>

                <tr class="tr-condition">
                    <th class="th-label">
                        踢人列表
                        <div class="description" id="kick-description"></div>
                    </th>
                    <td>
                        <textarea class="form-control" rows="5" name="data" placeholder="多条信息用换行分隔"></textarea>
                    </td>
                </tr>
            </table>
        </div>

        <div class="box-footer">
            <button type="submit" class="btn btn-default pull-right">确认</button>
            <div style="clear: both;"></div>
        </div>
    </div>
</form>

<script type="text/javascript">
    $(function(){
        var tipMap = {
            '1'       : '填写角色ID',
            '2'         : '填写角色名',
            '3'       : '填写玩家账号',
        };

        $("#sel-kick-type").change(function(){
            var kickType = $(this).val();
            $("#kick-description").html(tipMap[kickType] || '');
        }).change();

        $("#ck-kick-all").change(function(){
            if($(this).is(':checked')){
                $(".tr-condition").hide();
            }else{
                $(".tr-condition").show();
            }
        });
    });
</script>